import React from 'react'
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import App from './App'
import Login from './pages/login'
import Admin from './admin'
import Buttons from './pages/ui/buttons'
import NoMacth from './pages/nomatch'
import Modals from './pages/ui/modals'
import Loadings from './pages/ui/loadings'
import Notifications from './pages/ui/notifications'
import Messages from './pages/ui/message'
import Tabb from './pages/ui/tabs'

export default class IRouter extends React.Component {
    render() {
        return (
            <Router>
                <App>
                    <Route path="/" exact component={Login} />
                  <Route path="/login" component={Login} />
                    {/* 子路由 */}
                    <Route path="/admin" render={() =>
                        <Admin>
                            <Switch>
                                <Route path="/admin/home" exact component={Login} />
                                <Route path="/admin/ui/buttons" component={Buttons} />
                                <Route path="/admin/ui/modals" component={Modals} />
                                <Route path="/admin/ui/loadings" component={Loadings} />
                                <Route path="/admin/ui/notification" component={Notifications} />
                                <Route path="/admin/ui/messages" component={Messages} />
                                <Route path="/admin/ui/tabs" component={Tabb} />
                                
                                <Route component={NoMacth} />
                            </Switch>
                        </Admin>
                    } />
                    <Route path="/order/detail" component={Login} />

                </App>
            </Router>
        )
    }
}
